<?php
session_start();
require_once '../header.php';
function __autoload($className)
	{
    	require_once('../class/' . $className . '.class.php');
	}
session::need_manage();
if(!empty($_GET["control"]))
{
	$agentId=intval($_GET["agentid"]);
	if(session::is_manager()==TRUE)
	{
		$Control=$_GET["control"];
		if($Control==1)
		{
			$update=database::Update('agent',array(
			'id' => $agentId
			),array('enable' => 'Y'));
		}
		else if($Control==2)
		{
			$update=database::Update('agent',array(
			'id' => $agentId
			),array('enable' => 'N'));
		}
		echo "Edit Done";
	}
}
else
{
	$GetAgent=database::LimitQuery('agent',array(
	'select' => 'id,agent_name,enable,agent_class',
	));
	require_once '../html/agentcontrol.php';
}

?>